/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-07-21 11:42:21
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.gshop.pbpm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itttq.gshop.domain.po.SysSetPo;
import com.itttq.gshop.domain.to.ResultPageTo;
import com.itttq.gshop.pbpm.mapper.ISysSetMapper;

@Service
public class SysSetService {
	@Autowired
	private ISysSetMapper sysSetMapper;
	
	/**
	 * 根据ID获取SysSetPo对象
	 * 
	 * @param code
	 * @Author 迷蝶
	 * @return SysSetPo
	 */
	public SysSetPo getSysSet(String code) {
		return sysSetMapper.findSysSetByCode(code);
	}
	
	/**
	 * 根据条件获取SysSetPo对象，并返回查询的数据总数
	 * 
	 * @param sysSet
	 * @Author 迷蝶
	 * @return ResultPageTo<SysSetPo>
	 */
	public ResultPageTo<SysSetPo> getSysSets(SysSetPo sysSet) {
		return new ResultPageTo<SysSetPo>(sysSet.getStart(), sysSet.getSize(), 
				sysSetMapper.findSysSetCount(sysSet), sysSetMapper.findSysSets(sysSet));
	}
	
	/**
	 * 根据ID删除SysSetPo对象
	 * 
	 * @param id
	 * @Author 迷蝶
	 */
	public Integer delSysSet(String code) {
		return sysSetMapper.delSysSetBycode(code);
	}
	
	/**
	 * 增加SysSetPo对象
	 * 
	 * @param sysSet
	 * @Author 迷蝶
	 */
	public Integer addSysSet(SysSetPo sysSet) {
		return sysSetMapper.addSysSet(sysSet);
	}
	
	/**
	 * 根据条件更新SysSetPo对象
	 * 
	 * @param sysSet
	 * @Author 迷蝶
	 */
	public Integer updateSysSet(SysSetPo sysSet) {
		return sysSetMapper.updateSysSet(sysSet);
	}
	
}
